<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibTools: H:/project/LibTools/src/time/TimerBase.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibTools
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.16 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','搜索');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_798ee6f4f5cd9c6410c07a649b7662ec.html">time</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">TimerBase.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_timer_base_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef __TIMERBASE_H__</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define __TIMERBASE_H__</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &quot;../thread/SharedPtr.h&quot;</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;../time/Time.h&quot;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_sock_tools_8h.html">SockTools.h</a>&quot;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160; </div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="keyword">class </span><a class="code" href="class___timeout_info__.html">TimeoutInfo</a>;</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="keyword">class </span>CBasicServiceBase;</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160; </div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<a class="code" href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160; </div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<a class="code" href="_timer_base_8h.html#a3b1add812260ba5bef87b40a579a4d3a">EXPORT_SHARED_PTR</a>(<a class="code" href="tools_8h.html#a64152c8b939d1ce06c7c5cb6c97b62f8">LIBTOOLS</a>, <a class="code" href="class___timeout_info__.html">TimeoutInfo</a>);</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160; </div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="keyword">class </span><a class="code" href="tools_8h.html#a64152c8b939d1ce06c7c5cb6c97b62f8">LIBTOOLS</a> <a class="code" href="class_c_timer.html">CTimer</a></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;{</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;    <a class="code" href="tools_8h.html#af0d60cfe49f1e07cbec28c12afc4343e">delete_class_copy_operator</a>(<a class="code" href="class_c_timer.html">CTimer</a>);</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    <a class="code" href="class_c_timer.html">CTimer</a>(CBasicServiceBase* service);</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160; </div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    ~<a class="code" href="class_c_timer.html">CTimer</a>();</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160; </div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    <span class="keywordtype">bool</span> Reset();</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160; </div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <span class="keywordtype">bool</span> Cancel();</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160; </div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    <span class="keywordtype">void</span> SetTimer(<span class="keyword">const</span> <a class="code" href="class_c_time_base.html">CTimeBase</a>&amp; t, <a class="code" href="_sock_tools_8h.html#a65db86524d66ff5c871579e2dacf12ca">lpTimeoutCompleteFunc</a> func, <span class="keywordtype">void</span>* invoker = <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>);</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160; </div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <a class="code" href="class_c_machine_time.html">CMachineTime</a>* StartTime(<a class="code" href="class_c_machine_time.html">CMachineTime</a>&amp; t);</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160; </div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="keyword">static</span> <a class="code" href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> TimerComplete(<a class="code" href="class_c_sock_error.html">CSockError</a> ec, <span class="keywordtype">void</span>* invoker);</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <span class="keywordtype">void</span> SetTimer(<span class="keyword">const</span> <a class="code" href="class_c_time_base.html">CTimeBase</a>&amp;t, <span class="keyword">const</span> <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>&amp; func, <span class="keywordtype">void</span>* invoker = <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>);</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="class_c_timer.html#a71520e0e68129f9759a00383b34c8983">   64</a></span>&#160;    <a class="code" href="class_shared_ptr.html">SharedPtr&lt;TimeoutInfo&gt;</a> <a class="code" href="class_c_timer.html#a71520e0e68129f9759a00383b34c8983">_tinfo</a>;</div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="class_c_timer.html#a0131fa4a5035636cf6603900d25be408">   65</a></span>&#160;    CBasicServiceBase* <a class="code" href="class_c_timer.html#a0131fa4a5035636cf6603900d25be408">_tcpService</a>;</div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="class_c_timer.html#a13347fcbf490b91017644fc3f43692f0">   66</a></span>&#160;    <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="class_c_tcp_server.html">CTcpServer</a>;</div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="class_c_timer.html#a22a409cb83120f40cf2419f694137178">   67</a></span>&#160;    <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="class_c_tcp_client.html">CTcpClient</a>;</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="class_c_tcp_client.html">CTcpClient</a>;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="class_c_tcp_server.html">CTcpServer</a>;</div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="class_c_timer.html#a98d68824d5c09faeafd9eac9a8bc6f11">   70</a></span>&#160;    <span class="keyword">friend</span> <span class="keyword">class </span>CTcpTimer;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;};</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160; </div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<a class="code" href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160; </div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;<span class="preprocessor">#endif // __TIMERBASE_H__</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclass_c_tcp_client_html"><div class="ttname"><a href="class_c_tcp_client.html">CTcpClient</a></div><div class="ttdef"><b>Definition:</b> <a href="_tcp_client_8h_source.html#l00020">TcpClient.h:20</a></div></div>
<div class="ttc" id="aclass_c_sock_error_html"><div class="ttname"><a href="class_c_sock_error.html">CSockError</a></div><div class="ttdoc">套接字错误信息类</div><div class="ttdef"><b>Definition:</b> <a href="_sock_error_8h_source.html#l00013">SockError.h:13</a></div></div>
<div class="ttc" id="aclass_c_tcp_server_html"><div class="ttname"><a href="class_c_tcp_server.html">CTcpServer</a></div><div class="ttdef"><b>Definition:</b> <a href="_tcp_server_8h_source.html#l00019">TcpServer.h:19</a></div></div>
<div class="ttc" id="aclass_shared_ptr_html"><div class="ttname"><a href="class_shared_ptr.html">SharedPtr&lt; HandleBase &gt;</a></div></div>
<div class="ttc" id="aclass_c_time_base_html"><div class="ttname"><a href="class_c_time_base.html">CTimeBase</a></div><div class="ttdoc">时间基类</div><div class="ttdef"><b>Definition:</b> <a href="_time_8h_source.html#l00078">Time.h:78</a></div></div>
<div class="ttc" id="atools_8h_html_af0d60cfe49f1e07cbec28c12afc4343e"><div class="ttname"><a href="tools_8h.html#af0d60cfe49f1e07cbec28c12afc4343e">delete_class_copy_operator</a></div><div class="ttdeci">#define delete_class_copy_operator(ClassName)</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00345">tools.h:345</a></div></div>
<div class="ttc" id="a_timer_base_8h_html_a3b1add812260ba5bef87b40a579a4d3a"><div class="ttname"><a href="_timer_base_8h.html#a3b1add812260ba5bef87b40a579a4d3a">EXPORT_SHARED_PTR</a></div><div class="ttdeci">DEF_BEG_LIBTOOLS EXPORT_SHARED_PTR(LIBTOOLS, TimeoutInfo)</div></div>
<div class="ttc" id="atools_8h_html_a201ce692c9dca6599e5c12d00167419b"><div class="ttname"><a href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div><div class="ttdeci">#define DEF_BEG_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00036">tools.h:36</a></div></div>
<div class="ttc" id="atools_8h_html_a64152c8b939d1ce06c7c5cb6c97b62f8"><div class="ttname"><a href="tools_8h.html#a64152c8b939d1ce06c7c5cb6c97b62f8">LIBTOOLS</a></div><div class="ttdeci">#define LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00095">tools.h:95</a></div></div>
<div class="ttc" id="aclass___timeout_info___html"><div class="ttname"><a href="class___timeout_info__.html">_TimeoutInfo_</a></div><div class="ttdef"><b>Definition:</b> <a href="_timer_info_8h_source.html#l00040">TimerInfo.h:40</a></div></div>
<div class="ttc" id="atools_8h_html_ac909db71799bb22cb7d636a34cd785e4"><div class="ttname"><a href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div><div class="ttdeci">#define DEF_END_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00038">tools.h:38</a></div></div>
<div class="ttc" id="a_sock_tools_8h_html"><div class="ttname"><a href="_sock_tools_8h.html">SockTools.h</a></div></div>
<div class="ttc" id="atools_8h_html_a798af1e30bc65f319c1a246cecf59e39"><div class="ttname"><a href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a></div><div class="ttdeci">unsigned int DWORD</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00134">tools.h:134</a></div></div>
<div class="ttc" id="atools_8h_html_ab689500aaec0db066e3ac9483d3fe425"><div class="ttname"><a href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a></div><div class="ttdeci">#define NullPtr</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00119">tools.h:119</a></div></div>
<div class="ttc" id="aclass_c_timer_html"><div class="ttname"><a href="class_c_timer.html">CTimer</a></div><div class="ttdoc">定时器</div><div class="ttdef"><b>Definition:</b> <a href="_timer_8h_source.html#l00069">Timer.h:69</a></div></div>
<div class="ttc" id="aclass_c_machine_time_html"><div class="ttname"><a href="class_c_machine_time.html">CMachineTime</a></div><div class="ttdoc">机器时间类</div><div class="ttdef"><b>Definition:</b> <a href="_time_8h_source.html#l00149">Time.h:149</a></div></div>
<div class="ttc" id="a_sock_tools_8h_html_a65db86524d66ff5c871579e2dacf12ca"><div class="ttname"><a href="_sock_tools_8h.html#a65db86524d66ff5c871579e2dacf12ca">lpTimeoutCompleteFunc</a></div><div class="ttdeci">DWORD(* lpTimeoutCompleteFunc)(CSockError ec, void *invoker)</div><div class="ttdef"><b>Definition:</b> <a href="_sock_tools_8h_source.html#l00187">SockTools.h:187</a></div></div>
<div class="ttc" id="aclass_c_timer_html_a0131fa4a5035636cf6603900d25be408"><div class="ttname"><a href="class_c_timer.html#a0131fa4a5035636cf6603900d25be408">CTimer::_tcpService</a></div><div class="ttdeci">CBasicServiceBase * _tcpService</div><div class="ttdef"><b>Definition:</b> <a href="_timer_base_8h_source.html#l00065">TimerBase.h:65</a></div></div>
<div class="ttc" id="aclass_c_timer_html_a71520e0e68129f9759a00383b34c8983"><div class="ttname"><a href="class_c_timer.html#a71520e0e68129f9759a00383b34c8983">CTimer::_tinfo</a></div><div class="ttdeci">SharedPtr&lt; TimeoutInfo &gt; _tinfo</div><div class="ttdef"><b>Definition:</b> <a href="_timer_base_8h_source.html#l00064">TimerBase.h:64</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
